package com.mall.hadoop.job.grouptopic;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GrouptopicMap extends Mapper<LongWritable, Text, Text, IntWritable>{
	public static Logger logger = LoggerFactory.getLogger(GrouptopicMap.class);
	
	@Override
	protected void map(LongWritable key, Text value,
			Mapper<LongWritable, Text, Text, IntWritable>.Context context)
			throws IOException, InterruptedException {
		String dataBeas = value.toString();
		String[] splitDataBeas = dataBeas.split(",");
		for (String string : splitDataBeas) {
			  context.write(new Text(string),new IntWritable(1));
		}
	}
	
	
	
	
	
	
}
